<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //y g y模式为连续查找，如果不连续的话，只查找一个
        let web="usas"
        let reg=/u/y;
        console.log(reg.exec(web));
        console.log(reg.lastIndex);
        console.log(reg.exec(web));
        console.log(reg.lastIndex);
            // ['u', index: 0, input: 'usas', groups: undefined]
            //  1
            //  null
            // 0
    </script>
</body>
</html>